class EndPop extends egret.gui.SkinnableComponent{

    public constructor(){
        super();
        this.skinName = scene.EndPopSkin;
        this.addEventListener(egret.Event.ADDED_TO_STAGE,this.onAddToStage,this);
    }
    public __bg:egret.gui.Group;
    public __scoreTf:egret.gui.Label;
    public __closeBtn:egret.gui.Button;
    public __againBtn:egret.gui.Button;
    private onAddToStage(e:egret.Event):void{
        this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
        this.__bg.mask=new egret.Rectangle(0,0,this.__bg.width,this.__bg.height);
        this.__closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClickAgainGame,this);
        this.__againBtn.addEventListener(egret.TouchEvent.TOUCH_TAP,this.onClickAgainGame,this);
    }
    private onClickAgainGame(e:egret.TouchEvent):void{
        this.dispatchEvent(new GuiEvent(GuiEvent.AGAIN_GAME));
    }
    public setScore(s:number):void{
        this.__scoreTf.text=s.toString();
    }
}